import request from '@/utils/request'


export interface choisesModel {
    name: string,
    id: string
}

export type choisesListModel = choisesModel[]

export interface VideoPropertiesModel {
    choises: choisesListModel,
    formType: string,
    label: string,
    name: string,
    style: string,
    valueType: string
}

export type VideoPropertiesListModel = VideoPropertiesModel[]

// 视频课
// https://www.dance365.com/apis/moment/moments/collect/video_course/integrated?access_token=d6bb08ac-e9b4-4de0-9938-915c6503ad9e&pageSize=20&pageNum=0
const access_token = 'd6bb08ac-e9b4-4de0-9938-915c6503ad9e'
export default {
    getVideoProperties() {
        return request.get<any, VideoPropertiesListModel>('/apis/moment/properties/filter/video_course',{
            params: {
                access_token,
            }
        });
    },
    // 获取视频列表
    getVideoList(pageSize:number, pageNum:number) {
        // @ts-ignore
        return request.post<any, any>('/apis/moment/moments/collect/video_course/integrated', {},
            {params: {
                    access_token,
                    pageSize,
                    pageNum
            }}
        )
    },
    // 按价格由高到低  /apis/moment/moments/collect/video_course/priceDesc
    videoCoursePriceDesc(pageSize:number, pageNum:number) {
        return request.post<any, any>('/apis/moment/moments/collect/video_course/priceDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按价格有低到高排序/apis/moment/moments/collect/video_course/priceAsc
    videoCoursePriceAsc(pageSize:number, pageNum:number) {
        return request.post<any, any>('/apis/moment/moments/collect/video_course/priceAsc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按浏览量 /apis/moment/moments/collect/video_course/viewCountDesc
    videoCourseCountDesc(pageSize:number, pageNum:number) {
        return request.post<any, any>('/apis/moment/moments/collect/video_course/viewCountDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按销量 /apis/moment/moments/collect/video_course/sellCountDesc
    videoCourseSellCountDesc(pageSize:number, pageNum:number) {
        return request.post<any, any>('/apis/moment/moments/collect/video_course/sellCountDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按发布时间 /apis/moment/moments/collect/video_course/onsellTimeDesc
    videoSellTimeDesc(pageSize:number, pageNum:number) {
        return request.post<any, any>('/apis/moment/moments/collect/video_course/onsellTimeDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按评价由高到低 /apis/moment/moments/collect/video_course/favorableValueDesc
    videoCourseCommentDesc(pageSize:number, pageNum:number) {
      return request.post<any, any>('/apis/moment/moments/collect/video_course/favorableValueDesc', {}, {
          params: {
              access_token,
              pageSize,
              pageNum
          }
      })
    },
    // 获取直播课
    getLiveCourseList() {
        return request.get<any, any>('/apis/moment/properties/filter/live_course',{params: {access_token}})
    },
    // 获取直播视频课列表 /apis/moment/moments/collect/live_course/integrated?access_token=d6bb08ac-e9b4-4de0-9938-915c6503ad9e&pageSize=20&pageNum=0
    getLiveVideoList(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/live_course/integrated', {},{
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 直播课价格从高到低排序/apis/moment/moments/collect/live_course/priceDesc
    liveVideoCoursePriceDesc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/live_course/priceDesc',{},{
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 直播课价格从低到高排序/apis/moment/moments/collect/live_course/priceAsc
    liveVideoCoursePriceAsc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/live_course/priceAsc',{},{
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按销量 /apis/moment/moments/collect/live_course/sellCountDesc
    liveCourseSellCountDesc(pageSize:number, pageNum: number) {
        return request.post<any,any>('/apis/moment/moments/collect/live_course/sellCountDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按开课日期 /apis/moment/moments/collect/live_course/startTimeAsc
    liveCourseStartTimeAsc(pageSize:number, pageNum: number) {
        return request.post<any,any>('/apis/moment/moments/collect/live_course/startTimeAsc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按浏览量 /apis/moment/moments/collect/live_course/viewCountDesc
    liveCourseViewCountDesc(pageSize:number, pageNum: number) {
        return request.post<any,any>('/apis/moment/moments/collect/live_course/viewCountDesc', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 获取线下属性列表
    getMajorCourse() {
        return request.get<any, any>('/apis/moment/properties/filter/major_course', {
            params: access_token
        })
    },
    getMajorCourseVideoList(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/major_course/integrated', {}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按价格由高到低排序/apis/moment/moments/collect/major_course/priceDesc
    majorCoursePriceDesc(pageSize:number, pageNum: number){
        return request.post<any, any>("/apis/moment/moments/collect/major_course/priceDesc",{}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按价格由低到高排序/apis/moment/moments/collect/major_course/priceAsc
    majorCoursePriceAsc(pageSize:number, pageNum: number){
        return request.post<any, any>("/apis/moment/moments/collect/major_course/priceAsc",{}, {
            params: {
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按浏览量由高到低  /apis/moment/moments/collect/major_course/viewCountDesc
    viewCounterDesc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/major_course/viewCountDesc', {}, {
            params:{
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按销量 /apis/moment/moments/collect/major_course/sellCountDesc
    majorCourseSellCountDesc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/major_course/sellCountDesc', {}, {
            params:{
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按浏览量 /apis/moment/moments/collect/major_course/viewCountDesc
    majorCourseViewCountDesc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/major_course/viewCountDesc', {}, {
            params:{
                access_token,
                pageSize,
                pageNum
            }
        })
    },
    // 按日期 /apis/moment/moments/collect/major_course/onsellTimeDesc
    majorCourseOnSellTimeDesc(pageSize:number, pageNum: number) {
        return request.post<any, any>('/apis/moment/moments/collect/major_course/onsellTimeDesc', {}, {
            params:{
                access_token,
                pageSize,
                pageNum
            }
        })
    }

}